home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 API Bible / Windows 95 API Bible 3 Disc Set.iso / Win32 API Bible Book 1 of 3 / CHAPTE21 / EX8.C < prev    next >
C/C++ Source or Header  |  1995-05-29  |  2KB  |  43 lines

  1. #include <genstub.c>
  2.  
  3. LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
  4. {
  5.  
  6.    switch (uMsg)
  7.    {
  8.          case WM_COMMAND:
  9.                switch( LOWORD( wParam ) )
  10.                {
  11.                      case IDM_TEST:
  12.                      {
  13.                            STARTUPINFO si;
  14.                            char szBuffer[255];
  15.                            static char *szSWNames[11] = { "SW_HIDE",
  16.                               "SW_NORMAL", "SW_SHOWMINIMIZED","SW_MAXIMIZE",
  17.                               "SW_SHOWNOACTIVATE", "SW_SHOW", "SW_MINIMIZE",
  18.                               "SW_SHOWMINNOACTIVE", "SW_SHOWNA", "SW_RESTORE",
  19.                               "SW_SHOWDEFAULT" };
  20.  
  21.                            GetStartupInfo( &si );
  22.  
  23.                            wsprintf( szBuffer,
  24.                                      "SW: %s, Pos: (%d,%d), Size: (%d,%d) ",
  25.                                      szSWNames[si.wShowWindow],
  26.                                      si.dwX, si.dwY, si.dwXSize, si.dwYSize );
  27.                            MessageBox( hWnd, szBuffer, "Startup Info", MB_OK );
  28.                      }
  29.                      break;
  30.                      case IDM_EXIT:
  31.                            DestroyWindow( hWnd );
  32.                            break;
  33.                      break;
  34.                }
  35.                break;
  36.          case WM_DESTROY:
  37.                PostQuitMessage( 0 );
  38.          break;
  39.          default:
  40.                return( DefWindowProc( hWnd, uMsg, wParam, lParam ) );
  41.    }
  42.    return( NULL );
  43. }